"""
.. module:: CompositeCalendar
   :platform: Unix, Windows
   :synopsis: Calendars made up of other calendars
.. moduleauthor:: Nick Leaton <nickle@gmail.com>

"""

from Entities.Calendars.Calendar import Calendar

class CompositeCalendar (Calendar):
    '''
    A composite of calendars
    '''
    
    def __init__ (self, children=None):
        Calendar.__init__(self, " ".join ([calendar.code for calendar in children]), " - ".join ([calendar.name for calendar in children]))
        if children == None:
            children = []
        else:
            self.children = children
        
    def __repr__ (self):
        return "<%s (%s)>\n" % (self.__class__.__name__, ", ".join ([cal.code for cal in self.children]))
    
        